#ifndef __AS_SCROLL_BAR__H__
#define __AS_SCROLL_BAR__H__

#include "ASControl.h"
#include "ASImage.h"

typedef enum
{
    AS_SCROLLBAR_VERTICAL,
    AS_SCROLLBAR_HORIZONTAL,

    AS_SCROLLBAR_LAYOUT_MAX
} as_scrollbar_layout;


typedef struct
{
    /* base */
    as_control base;

    /* attributes */
    as_scrollbar_layout layout;

    //for image type
    as_image* tail_img;
    as_image* tile_img;
    //for color type
    ASUINT color;
    //divide the total content into 3 parts: hide height 1 ~ show height ~ hide height 2
    ASUINT hh1, sh, hh2;
    as_rect show_area;
    ASUINT fix_value, min_len;

    /* methods */
    as_ret (*set_img)(as_control* ctrl_p, ASWSTR tail_path, ASWSTR tile_path, as_image_src_type type);
    as_ret (*set_color)(as_control* ctrl_p, ASUINT color);
    as_ret (*set_value)(as_control* ctrl_p, ASUINT hh1, ASUINT sh, ASUINT hh2);

} as_scrollbar;


as_scrollbar* as_ctrl_scrollbar_create(as_rect area, as_scrollbar_layout layout);

as_ret as_ctrl_scrollbar_destory(as_scrollbar* sb_p);

#endif//__AS_SCROLL_BAR__H__